home *** CD-ROM | disk | FTP | other *** search
- Path: news.bridge.net!news
- From: David Byrden <100101.2547@compuserve.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Help! Allocating 3 dimensional or greater arrays in C++
- Date: 2 Feb 1996 04:26:18 GMT
- Organization: self-employed
- Message-ID: <4es3pa$g4m@news.bridge.net>
- References: <310CD09F.1D71@ns.vvm.com>
- NNTP-Posting-Host: ppp-mia3-103.bridge.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
-
-
- >> int *matrix;
- >> int **pmatrix = &matrix;
- >> int ***ppmatrix = &pmatrix;
- >> int size;
- >> matrix = new int[10];
- >> pmatrix = new matrix[10];
- >> ppmatrix = new pmatrix[10];
-
- This all goes sadly wrong at "new matrix[10]"
-
- The "new" keyword requires a type name, but "matrix" is a variable's name.
-
- Why not try new int[10][10][10]
-
-
- David
-
-
-
-